/*
 * 中断和异常处理测试头文件
 */

#ifndef TRAP_TEST_H
#define TRAP_TEST_H

// 测试函数声明
void test_interrupt_system(void);
void test_timer_interrupt(void);
void test_exception_handling(void);
void test_interrupt_overhead(void);
void run_all_trap_tests(void);

// 测试辅助宏
#define TRAP_ASSERT(cond, msg) do { \
    if (!(cond)) { \
        printf("  TRAP_ASSERT failed: %s\n", msg); \
        trap_tests_failed++; \
    } else { \
        trap_tests_passed++; \
    } \
} while (0)

#define TRAP_TEST_START(name) do { \
    printf("Starting test: %s\n", name); \
} while (0)

#define TRAP_TEST_END(name) do { \
    printf("Test completed: %s\n", name); \
} while (0)

// 测试统计变量
extern int trap_tests_passed;
extern int trap_tests_failed;

#endif // TRAP_TEST_H